
function removeTextNull(paramID)
{
	document.getElementById(paramID).value = '';
}
function removeCheckbox(obj_set_name)
{
	var checkboxes = document.getElementsByName(obj_set_name);
	var total_boxes = checkboxes.length;
	for(i=0; i<total_boxes; i++ )
	{
		current_value = checkboxes[i].checked;
		if(current_value == true)
		{
			checkboxes[i].checked = false;
		}
	}
}

function addCheckInLable(value,obj_set_name,lableshow)
{
	var test,flagExit = 0;
	var checkboxes = document.getElementsByName(obj_set_name);
	var total_boxes = checkboxes.length;
	var valuelableSP = document.getElementById(lableshow).value;
	for(i=0; i<total_boxes; i++ )
	{
		current_value = checkboxes[i].checked;
		if(current_value == true)
		{
			test = valuelableSP.search(value);
			if(test != -1)
			{
				flagExit = 1;
				break;
			}
			if(valuelableSP != '' )
				valuelableSP += '|';
			valuelableSP += value;
			break;
		}
		
		else
		{
			test = valuelableSP.search(value);
			if(test != -1)
			{
				flagExit = 1;
				break;
			}
		}
		
	}
	if(flagExit == 1)
	{	
		flagExit = 0;
		var temp;
		if(test == 0)
		{
			var lenghtValue = value.length;
			var lenghtvaluelableSP = valuelableSP.length;
			if(lenghtValue == lenghtvaluelableSP)
				temp = value;
			else
				temp = value+'|';
		}
		else
		{
			temp = '|'+value;
		}
		valuelableSP = valuelableSP.replace(temp,'');
	}
	document.getElementById(lableshow).value = valuelableSP;
}		


function switchSetting(check_all_box, obj_set_name)
{
	//alert(obj_set_name);
	var selection_status = check_all_box.checked;
	//alert(selection_status);
	if(selection_status == false)
	{
		uncheckAll(obj_set_name);
	}
	else
	{
		checkAll(obj_set_name);
	}
}

function switchSetting_disable(check_all_box, obj_set_name)
{
	//alert("vao");
	var selection_status = check_all_box.checked;
	//alert(selection_status);
	if(selection_status == false)
	{
		uncheckAll_disable(obj_set_name);
	}
	else
	{
		checkAll_disable(obj_set_name);
	}
}

function checkAll(obj_set_name)
{

	var checkboxes = document.getElementsByName(obj_set_name);
	
	var total_boxes = checkboxes.length;
	//alert( checkboxes[0].checked);
	
	for(i=0; i<total_boxes; i++ )
	{
		current_value = checkboxes[i].checked;
	
		if(current_value == false)
		{
			checkboxes[i].checked = true;
		}
	}
	
}

function checkAll_disable(obj_set_name)
{

	var checkboxes = document.getElementsByName(obj_set_name);
	
	var total_boxes = checkboxes.length;
	//alert( checkboxes[0].checked);
	
	for(i=0; i<total_boxes; i++ )
	{
		current_value = checkboxes[i].checked;
		disable_value = checkboxes[i].disabled;
		if(current_value == false && disable_value == false)
		{
			checkboxes[i].checked = true;
		}
	}
	
}

function uncheckAll(obj_set_name)
{
	var checkboxes = document.getElementsByName(obj_set_name);
	var total_boxes = checkboxes.length;
	//alert(obj_set_name);

	for(i=0; i<total_boxes; i++ )
	{
		current_value = checkboxes[i].checked;
	
		if(current_value == true)
		{
			checkboxes[i].checked = false;
		}
	}
}

function uncheckAll_disable(obj_set_name)
{
	var checkboxes = document.getElementsByName(obj_set_name);
	var total_boxes = checkboxes.length;
	//alert(obj_set_name);

	for(i=0; i<total_boxes; i++ )
	{
		current_value = checkboxes[i].checked;
		disable_value = checkboxes[i].disabled;	
		//alert(disable_value);
		if(current_value == true && disable_value == false)
		{
			checkboxes[i].checked = false;
		}
	}
}